package com.cdgc.web.service.Impl;

import com.cdgc.web.mapper.MendianMapper;
import com.cdgc.web.pojo.Mendian;
import com.cdgc.web.service.MendianService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MendianServiceImpl implements MendianService {

    @Resource
    private MendianMapper mendianMapper;

    @Override
    public List<Mendian> queryAllMendians() {
        return mendianMapper.selectByExample(null);
    }

    @Override
    public void addNewMendian(Mendian mendian) {
        mendianMapper.insert(mendian);
    }

    @Override
    public Mendian queryMendianById(int mid) {
        return mendianMapper.selectByPrimaryKey(mid);
    }

    @Override
    public void updateMendian(Mendian mendian) {
        mendianMapper.updateByPrimaryKey(mendian);
        return ;
    }
}
